var Input = {};
Input.keyDown=function(e){ 
	switch(e.keyCode)
	{
		case 87: Game.player1.y--; if(Game.player1.y < 1) { Game.player1.y = 1;} break;
		case 83: Game.player1.y++; if(Game.player1.y > 14) { Game.player1.y = 14;} break;
		case 65: Game.player1.x--; if(Game.player1.x < 1) { Game.player1.x = 1;} break;
		case 68: Game.player1.x++; if(Game.player1.x > 14) { Game.player1.x = 14;} break;
		
		case 73: Game.player2.y--; if(Game.player2.y < 1) { Game.player2.y = 1;} break;
		case 75: Game.player2.y++; if(Game.player2.y > 14) { Game.player2.y = 14;} break;
		case 74: Game.player2.x--; if(Game.player2.x < 1) { Game.player2.x = 1;} break;
		case 76: Game.player2.x++; if(Game.player2.x > 14) { Game.player2.x = 14;} break;
		
		case 13: Game.reset(); break;
		
	};
};

Input.initialize = function()
{
	window.addEventListener('keydown',Input.keyDown,true);
};

